home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / manageme / tcpdump-.001 / tcpdump-~ / tcpdump-3.0.2-linux / linux-include / netinet / if_ether.h next >
Encoding:
C/C++ Source or Header  |  1994-07-02  |  1.8 KB  |  63 lines

  1. /*
  2.  * Copyright (c) 1982, 1986 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that this notice is preserved and that due credit is given
  7.  * to the University of California at Berkeley. The name of the University
  8.  * may not be used to endorse or promote products derived from this
  9.  * software without specific prior written permission. This software
  10.  * is provided ``as is'' without express or implied warranty.
  11.  *
  12.  *    @(#)if_ether.h 1.28 89/08/04 SMI; from UCB 7.2 12/7/87
  13.  */
  14.  
  15. #ifndef _netinet_if_ether_h
  16. #define _netinet_if_ether_h
  17. #include <net/if_arp.h>
  18.  
  19. /*
  20.  * Ethernet address - 6 octets
  21.  */
  22. struct ether_addr {
  23.     u_char    ether_addr_octet[6];
  24. };
  25.  
  26. /*
  27.  * Structure of a 10Mb/s Ethernet header.
  28.  */
  29. struct    ether_header {
  30.     struct    ether_addr ether_dhost;
  31.     struct    ether_addr ether_shost;
  32.     u_short    ether_type;
  33. };
  34.  
  35. #define    ETHERTYPE_PUP        0x0200        /* PUP protocol */
  36. #define    ETHERTYPE_IP        0x0800        /* IP protocol */
  37. #define    ETHERTYPE_ARP        0x0806        /* Addr. resolution protocol */
  38. #define    ETHERTYPE_REVARP    0x8035        /* Reverse ARP */
  39. #define ETHERTYPE_TRAIL        0x1000
  40.  
  41. /*
  42.  * Ethernet Address Resolution Protocol.
  43.  *
  44.  * See RFC 826 for protocol description.  Structure below is adapted
  45.  * to resolving internet addresses.  Field names used correspond to
  46.  * RFC 826.
  47.  */
  48. struct    ether_arp {
  49.     struct    arphdr ea_hdr;        /* fixed-size header */
  50.     struct    ether_addr arp_sha;    /* sender hardware address */
  51.     u_char    arp_spa[4];        /* sender protocol address */
  52.     struct    ether_addr arp_tha;    /* target hardware address */
  53.     u_char    arp_tpa[4];        /* target protocol address */
  54. };
  55. #define    arp_hrd    ea_hdr.ar_hrd
  56. #define    arp_pro    ea_hdr.ar_pro
  57. #define    arp_hln    ea_hdr.ar_hln
  58. #define    arp_pln    ea_hdr.ar_pln
  59. #define    arp_op    ea_hdr.ar_op
  60.  
  61. #define ETHERMTU    1500
  62. #endif /*!_netinet_if_ether_h*/
  63.